/**
 * 
 */
layui.use(['jquery','util','carousel'],function(){
	var $=layui.jquery,
	util = layui.util;
	function time(){
		var time=util.toDateString(new Date(),"yyyy年MM月dd日 HH:mm:ss");
		$("#time").text(time);
	}
	time();
	setInterval(time,1000);
	var carousel = layui.carousel;
	  //建造实例
	  carousel.render({
	    elem: '#test1'
	    ,width: '100%' //设置容器宽度
	    ,arrow: 'always', //始终显示箭头
	    //,anim: 'updown' //切换动画方式
	    	autoplay:"true"
	  });
});
var  chart=echarts.init(document.getElementById('echart'));
chart.showLoading({  
            text: '正在努力加载中...'  
 });
option = {
	    title : {
	        text: '我的任务',
	        x:'center'
	    },
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    legend: {
	        orient: 'vertical',
	        left: 'left',
	        data: ['未完成','进行中','已完成',]
	    },
	    series : [
	        {
	            name: '访问来源',
	            type: 'pie',
	            radius : '55%',
	            center: ['50%', '60%'],
	            data:[
	                {value:35, name:'未完成'},
	                {value:310, name:'进行中'},
	                {value:234, name:'已完成'}
	            ],
	            itemStyle: {
	                emphasis: {
	                    shadowBlur: 10,
	                    shadowOffsetX: 0,
	                    shadowColor: 'rgba(0, 0, 0, 0.5)'
	                }
	            }
	        }
	    ]
	};
chart.setOption(option);
chart.hideLoading();